package com.sen.organization.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sen.common.common.bo.PeopleInfo;
import com.sen.organization.bo.SearchPeopleBO;
import com.sen.organization.bo.SearchPeopleFlowBO;
import com.sen.organization.dto.MemberPeopleBaseInfoDTO;
import com.sen.organization.model.MemberPeople;
import org.apache.ibatis.annotations.Param;

/**
 * @author esjiang
 */
public interface MemberPeopleDao extends BaseMapper<MemberPeople> {

    /**
     * 查询人员信息列表
     * @param page
     * @param cname
     * @param entityCode
     * @return
     */
    IPage<SearchPeopleBO> listSearchPeople(Page<SearchPeopleBO> page, @Param("cname") String cname, @Param("entityCode") String entityCode);

    /**
     * 查询人员-工作流选人
     * @param page
     * @param cname
     * @param tenantCode
     * @param departmentCode
     * @return
     */
    IPage<SearchPeopleFlowBO> listSearchPeopleByFlow(Page<SearchPeopleBO> page, @Param("cname") String cname,
                                                     @Param("tenantCode") String tenantCode,
                                                     @Param("departmentCode") String departmentCode);

    /**
     * 查询人员信息，包括部分主体信息
     * @param id
     * @return
     */
    MemberPeopleBaseInfoDTO getPeopleInfo(@Param("id") long id) ;

    /**
     * 根据登录名查询人员信息
     * @param userName
     * @return
     */
    PeopleInfo getPeopleInfoByLogin(@Param("userName") String userName) ;
}
